<?php
Yii::import('ext.mbmenu.MbMenu');
class Menu extends MbMenu {
	
	public function init() {
		$this->items = $this->initItems($this->items);
		parent::init();
	}
	
	public function initItems($items) {
		$menuItems = array();
		foreach($items as $k=>$v) {
			if(is_array($v)) {
				if(isset($v['class'])) {
					$menuItems = array_merge($menuItems, Yii::createComponent($v)->getItems());
				} else {
					$menuItems[$k] = $this->initItems($v);
				}
			} else {
				$menuItems[$k] = $v;
			}
		}
		return $menuItems;
	}
}

class MenuItemProvider extends CComponent {
	
	public function getItems() {
		return array(
		);
	}
	
}
?>